From: Cosimo Cecchi Date: Fri, 1 Mar 2013 02:25:05 +0000 (-0500) Subject: messageTray: add an indicatorCount property X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~4607 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=bdbea2463b6cdfacbd6cbc78ae1b3f03b86abd1e;p=gnome-shell.git messageTray: add an indicatorCount property This filters out resident and transient notifications in the normal case, but just returns the number of unread messages for the Telepathy implementation. https://bugzilla.gnome.org/show_bug.cgi?id=687787 --- diff --git a/js/ui/components/telepathyClient.js b/js/ui/components/telepathyClient.js index 72df82d67..b07ea9516 100644 --- a/js/ui/components/telepathyClient.js +++ b/js/ui/components/telepathyClient.js @@ -640,6 +640,10 @@ const ChatSource = new Lang.Class({ return this._pendingMessages.length; }, + get indicatorCount() { + return this.count; + }, + get unseenCount() { return this.count; }, diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index 14c55db63..2df4abc48 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -1153,6 +1153,11 @@ const Source = new Lang.Class({ return this.notifications.length; }, + get indicatorCount() { + let notifications = this.notifications.filter(function(n) { return !n.isTransient && !n.resident; }); + return notifications.length; + }, + get unseenCount() { return this.notifications.filter(function(n) { return !n.acknowledged; }).length; },